home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-13 | 10.8 KB | 443 lines | [TEXT/MPS ] |
- /*
- File: TextEditorUtils.idl
-
- Contains: TextEditor object interface
-
- Written by: Steve Smith
-
- Copyright: © 1994-1995 by Apple Computer, Inc., all rights reserved.
- */
-
-
- #ifndef _TEXTEDITOR_
- #define _TEXTEDITOR_
-
- #ifndef _PART_
- #include "Part.idl"
- #endif
-
- #ifndef _TEXTEDITORVERS_
- #include "TextEditorVers.h"
- #endif
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- interface ODFocusSet;
- interface ODMenuBar;
- interface ODSession;
- interface ODWindow;
- interface ODFrame;
- interface TextEditorSemIntf;
- interface TextEditorSettingsExt;
- interface TextEditorTransferExt;
-
-
- #ifdef __PRIVATE__
- //==============================================================================
- // Implementation Types
- //==============================================================================
-
- typedef somToken CTSMTextension;
- typedef somToken CRulerUI;
- typedef somToken CPartRun;
- typedef somToken Handle;
- typedef somToken WindowProperties;
- typedef somToken CList;
- typedef somToken CFrameList;
- typedef somToken ControlHandle;
- typedef somToken DragData;
- typedef somToken Samples_PaletteExt;
-
- #endif
-
- //==============================================================================
- // TextEditor
- //==============================================================================
-
- module SampleCode
- {
-
- interface TextEditor : ODPart
- {
- #ifdef __PRIVATE__
-
- // -- Initialization --
-
- void Initialize();
-
- // -- Storage --
-
- ODShape CalcNewUsedShape(in ODFrame frame);
- void UpdateFrame(in ODFrame frame, in ODTypeToken view,
- in ODShape usedShape);
- WindowProperties* GetSavedWindowProperties(in ODFrame frame);
- WindowProperties* GetDefaultWindowProperties(in ODFrame frame, in Rect windowRect);
- void CheckAndAddProperties(in ODStorageUnit storageUnit);
- void InternalizeStateInfo(in ODStorageUnit storageUnit);
- ODULong InternalizeContent(in ODStorageUnit storageUnit, in ODPtr selRange);
- void ExternalizeStateInfo(in ODStorageUnit storageUnit,
- in ODDraftKey key, in ODFrame scopeFrame);
- void ExternalizeContent(in ODStorageUnit storageUnit, in ODPtr selRange);
- void CleanseContentProperty(in ODStorageUnit storageUnit);
-
- // -- Event Handling --
-
- ODBoolean HandleMenuEvent(in ODEventData event, in ODFrame frame);
- ODBoolean HandleWindowEvent(in ODEventData event, in ODFrame frame);
- ODBoolean HandleMouseEvent(in ODEventData event, in ODFacet facet, in ODEventInfo eventInfo);
- ODBoolean HandleRulerMouseEvent(in ODEventData event, in ODFacet facet, in ODEventInfo eventInfo);
- void DoMouseEvent(in ODFacet facet, in Point where, in ODEventData event);
- ODBoolean HandleKeyboardEvent(in ODEventData event, in ODFrame frame);
- void DoIdle(in ODFrame frame);
- void DoDialogBox(in ODFrame frame, in ODSShort dialogID, in ODUShort errorNumber);
-
- // -- Imaging --
-
- void DrawFrameView(in ODFacet facet);
- void DrawIconView(in ODFacet facet);
- void DrawThumbnailView(in ODFacet facet);
- void GenerateThumbnail(in ODFrame frame);
-
- // -- Activation --
-
- ODBoolean ActivateFrame(in ODFrame frame);
- void WindowActivating(in ODFrame frame, in ODBoolean activating);
- void RelinquishAllFoci(in ODFrame frame);
- ODBoolean Activate(in ODFacet facet);
- void PartActivated(in ODFrame frame);
-
- // -- Layout --
-
- ODWindow AcquireFramesWindow(in ODFrame frame);
- ODWindow CreateWindow(in ODFrame frame, in ODType frameType,
- in WindowProperties* windowProperties);
- void CleanupWindow(in ODFrame frame);
- Rect CalcPartWindowSize(in ODFrame sourceFrame);
- Rect CalcPartWindowPosition(in ODFrame frame, in Rect partWindowBounds);
- ODFacet GetActiveFacetForFrame(in ODFrame frame);
- void CleanupDisplayFrame(in ODFrame frame, in ODBoolean frameRemoved);
-
- // == Misc ==
-
- // -- Misc --
-
- void SetDirty();
- void HandleChange();
- void CalcViewRect(in ODFrame frame);
- ODBoolean HasValidData(in ODStorageUnit su, out ODBoolean requiresTranslation);
- void UpdateScriptRunnerState();
-
- // -- Command Handling --
-
- void DoAboutBox(in ODFrame frame);
- void DoCut(in ODFrame frame);
- void DoCopy(in ODFrame frame);
- void DoPaste(in ODFrame frame);
- void DoPasteAs(in ODFrame frame);
- void DoClear(in ODFrame frame);
- void DoSelectAll(in ODFrame frame);
- void DoPageSetup(in ODFrame frame);
- void DoPrint(in ODFrame frame);
- void DoUndo(in ODFrame frame, in ODBoolean undo);
- void DoPreferences(in ODFrame frame);
- void DoSettings(in ODFrame frame);
-
- // -- Selection --
-
- void DoDragSelection(in ODEventData event, in ODFacet facet);
- void CalcSelectionRgn(in ODFacet facet);
-
- // -- I/O --
-
- void StreamDataOut(in ODStorageUnitView suView, in ODPtr selRange, in ODUByte ioFlags);
- ODSLong StreamDataIn(in ODStorageUnitView suView, in ODPtr selRange, in ODUByte ioFlags);
- ODBoolean GetText(in ODPlatformType type, out ODPtr textPtr, out ODSize size);
- ODBoolean SetText(in ODPlatformType type, in ODPtr textPtr, in ODSize size);
-
- void StartTextension();
- void InitializeTextension(in ODBoolean isRoot);
- void ActivateTextension(in ODFrame frame, in ODBoolean activate);
-
- // -- Text Bounds --
-
- void CalcTextBounds(in ODFrame frame);
- void DrawPageBounds();
-
- // -- Scroll Bars --
-
- void ActivateScrollbars(in ODBoolean activate);
- void AdjustScrollbars(in ODFrame frame);
- void RepositionScrollbars(in ODFrame frame);
- void MakeSelectionVisible(in ODFrame frame);
- void DoScrollDocument(in ODFacet facet, in Point mouse, in ODSShort partCode,
- in ControlHandle scrollbar);
-
- // -- Ruler --
-
- void ShowHideRuler(in ODFrame frame);
-
- // -- Menus --
-
- void LoadMenus();
- ODBoolean DoTextStyling(in ODFrame frame, in ODID command);
- void RealFontSizeMenu(in ODUShort fontNum);
- void AdjustEditMenu(in ODFrame frame);
- void AdjustTextEditorMenus(in ODFrame frame);
- void AdjustDynamicMenuItems(in ODFrame frame);
- void DoOtherFontSize(in ODFrame frame, inout ODSShort fontSize);
-
- // -- Cursor Tracking --
-
- void MouseEnter(in ODFacet facet, in ODPoint where);
- void MouseWithin(in ODFacet facet, in ODPoint where);
- void MouseLeave(in ODFacet facet);
-
- // -- Misc. --
-
- ODBoolean NotDragSelection(in ODFacet facet, in Point where, in ODEventData event);
- ODBoolean TranslateForeignData(in ODStorageUnit su);
-
- #endif
-
- #ifdef __SOMIDL__
- implementation
- {
- majorversion = currentMajorVersion;
- minorversion = currentMinorVersion;
-
- functionprefix = TextEditor__;
-
- override:
- //# ODObject methods
- somInit,
- somUninit,
- AcquireExtension,
- HasExtension,
- Purge,
- ReleaseExtension,
-
- //# ODRefCountedObject methods
- Release,
-
- //# ODPersistentObject methods.
- CloneInto,
- Externalize,
- ReleaseAll,
-
- //# ODPart methods
- AbortRelinquishFocus,
- AdjustBorderShape,
- AdjustMenus,
- AttachSourceFrame,
- BeginRelinquishFocus,
- CanvasChanged,
- CanvasUpdated,
- ChangeKind,
- ClonePartInfo,
- CommitRelinquishFocus,
- ContainingPartPropertiesUpdated,
- CreateLink,
- DisplayFrameAdded,
- DisplayFrameClosed,
- DisplayFrameConnected,
- DisplayFrameRemoved,
- DisposeActionState,
- DragEnter,
- DragLeave,
- DragWithin,
- Draw,
- Drop,
- ExternalizeKinds,
- FacetAdded,
- FacetRemoved,
- FocusAcquired,
- FocusLost,
- FrameShapeChanged,
- FulfillPromise,
- GeometryChanged,
- GetPrintResolution,
- HandleEvent,
- HighlightChanged,
- InitPart,
- InitPartFromStorage,
- LinkStatusChanged,
- LinkUpdated,
- Open,
- PresentationChanged,
- ReadActionState,
- ReadPartInfo,
- RedoAction,
- RevealLink,
- SequenceChanged,
- UndoAction,
- ViewTypeChanged,
- WriteActionState,
- WritePartInfo;
-
- releaseorder:
- Initialize,
- CalcNewUsedShape,
- UpdateFrame,
- GetSavedWindowProperties,
- GetDefaultWindowProperties,
- CheckAndAddProperties,
- InternalizeStateInfo,
- InternalizeContent,
- ExternalizeStateInfo,
- CleanseContentProperty,
- ExternalizeContent,
- HandleMenuEvent,
- HandleWindowEvent,
- HandleMouseEvent,
- HandleRulerMouseEvent,
- DoMouseEvent,
- HandleKeyboardEvent,
- DrawFrameView,
- DrawIconView,
- DrawThumbnailView,
- ActivateFrame,
- WindowActivating,
- AcquireFramesWindow,
- CreateWindow,
- CalcPartWindowSize,
- CalcPartWindowPosition,
- SetDirty,
- DoAboutBox,
- DoDialogBox,
- GenerateThumbnail,
- GetActiveFacetForFrame,
- CalcViewRect,
- ActivateTextension,
- ActivateScrollbars,
- HasValidData,
- DoCut,
- DoCopy,
- DoPaste,
- DoPasteAs,
- DoClear,
- DoSelectAll,
- DoPageSetup,
- DoPrint,
- DoUndo,
- DoPreferences,
- DoSettings,
- DoIdle,
- DoDragSelection,
- CalcSelectionRgn,
- StreamDataOut,
- StreamDataIn,
- GetText,
- SetText,
- StartTextension,
- InitializeTextension,
- CalcTextBounds,
- AdjustScrollbars,
- RepositionScrollbars,
- MakeSelectionVisible,
- DoScrollDocument,
- ShowHideRuler,
- LoadMenus,
- DoTextStyling,
- DrawPageBounds,
- RealFontSizeMenu,
- AdjustEditMenu,
- AdjustTextEditorMenus,
- AdjustDynamicMenuItems,
- DoOtherFontSize,
- MouseEnter,
- MouseWithin,
- MouseLeave,
- NotDragSelection,
- Activate,
- TranslateForeignData,
- RelinquishAllFoci,
- PartActivated,
- CleanupWindow,
- CleanupDisplayFrame,
- HandleChange,
- UpdateScriptRunnerState;
-
- #ifdef __PRIVATE__
-
- passthru C_xh =
- ""
- "class CPartRun;"
- "class Samples_PaletteExt;"
- ""
- "#ifndef _WINUTILS_"
- "#include <WinUtils.h>"
- "#endif"
- ""
- "#ifndef SOM_TextEditorSemIntf_xh"
- "#include <TextEditorSemIntf.xh>"
- "#endif"
- ""
- "#ifndef SOM_TextEditorSettingsExt_xh"
- "#include <TextEditorSettingsExt.xh>"
- "#endif"
- ""
- "#ifndef SOM_TextEditorTransferExt_xh"
- "#include <TextEditorTransferExt.xh>"
- "#endif"
- ""
- "#ifndef _SAMPLECOLLECTIONS_"
- "#include <SampleCollections.h>"
- "#endif"
- ""
- "#include <Printing.h>"
- "#include <Controls.h>"
- "#include <Quickdraw.h>";
-
- passthru C_xih =
- ""
- "class CList;"
- "class CFrameList;"
- "class CTSMTextension;"
- "class CRulerUI;"
- "class Samples_PaletteExt;"
- "class DragData;"
- "";
-
- ODPart fSelf;
- CList* fDisplayFrames;
- ODBoolean fDirty;
- ODBoolean fReadOnlyStorage;
- TextEditorSemIntf fSemanticIntf;
- TextEditorSettingsExt fSettingsExt;
- TextEditorTransferExt fTextTransferExt;
-
- Handle fSelectionRgn;
- DragData* fDragData;
-
- CTSMTextension* fTextension;
- ODBoolean fTextensionInitialized;
- ODID fRulerPalette;
- Handle fPrintRecord;
-
- ODTypeToken fPreferredKind;
-
- Rect fPaperSize;
- Rect fPageSize;
- Rect fPageMargins;
- ODUShort fTextAlignment;
-
- ControlHandle fVScrollbar;
- ControlHandle fHScrollbar;
-
- Samples_PaletteExt* fScriptPaletteExt;
- ODBoolean fIsScriptRunnerOn;
- ODBoolean fIsScriptRunnerHidden;
-
- #endif
-
- }; // implementation
-
- #endif
- }; // interface
- }; // module
-
- #endif // _ODTEXTEDITOR_
-
-